package org.toycode.solr.extractor;

import java.util.List;
import org.apache.solr.common.SolrInputDocument;
import org.toycode.solr.config.Prop;

/**
 * The implementations of this interface provide the content extraction for
 * corresponding property type in config.xml.
 *
 * @author <a href="mailto:DL88250@gmail.com">Liang Ding</a>
 * @version 1.0.0.1, Aug 26, 2009
 */
public interface PropertyExtractor {

    /**
     * Extracts the specified property's content by its type from the specified
     * value object, and adds the content into the specified solr input document.
     *
     * @param prop property
     * @param value the specified value object
     * @param solrInputDocument the specified solr input document
     */
    void process(final Prop prop, final Object value,
                 final SolrInputDocument solrInputDocument);

    /**
     * Gets the extractable types of this property extractor.
     *
     * @return a list of extractable types
     */
    List<String> getExtractableTypes();
}
